package com.dataimport.utils;

import com.dataimport.entity.targetentity.FunnyRunInfo;

import java.lang.reflect.Field;

/**
 * @author 卑微小峰
 * @date 2022/9/27
 */
public class HasNullFieldUtil {

    /**
     * 不存在属性为空的字段就返回true
     */
    public static boolean inExistenceNull(Object obj) {
        Field[] fields = obj.getClass().getDeclaredFields();
        for (Field field : fields) {
            field.setAccessible(true);
            try {
                if (null == field.get(obj)) {
                    return false;
                }
            } catch (IllegalAccessException e) {
                e.printStackTrace();
            }
        }
        return true;
    }
}
